<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class ApiVarTable api接口变量表
 */
class ApiVarTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('api_var', function (Blueprint $blueprint) {
            $blueprint->increments('var_id')->comment('变量id');
            $blueprint->string('name')->comment('变量名称');
            $blueprint->string('value')->comment('变量值');
            $blueprint->string('env')->comment('请求环境(local,test,release)');
            $blueprint->string('remark')->comment('备注');
            $blueprint->softDeletes();
            $blueprint->timestamps();
            $blueprint->index(['env'], 'idx_env');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('api_var');
    }
}
